<template>
  <div>
    <h1 v-text="msg" ref="title"></h1>
    <button @click="showDom">点我获取dom对象</button>
    <SchoolName ref="sch"></SchoolName>
  </div>
</template>

<script>
import SchoolName from "./components/School.vue";
export default {
  data() {
    return {
      msg: "欢迎来到尚硅谷",
    };
  },

  components: { SchoolName },

  methods:{
    showDom(){
        console.log(this.$refs.title)
        console.log(this.$refs.sch)
    }
  }
};
</script>

<style></style>
